import { Router } from 'express'

import Jwt from '../utils/token'

const router = Router()

// 没有挂载路径的中间件,通过该路由的每个请求都会执行该中间件
router.use((req, res, next) => {
	console.log(req.url, req.method)
	switch (req.method) {
		case 'GET':
			console.log(req.query)
			break
		default:
			console.log('body >  ', req.body)
			break
	}
	next()
})

export default router
